package org.googlecode.lightning.search.index;

import java.io.File;
import java.io.IOException;
import java.io.Serializable;

import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.index.IndexWriter;

/**
 * 
 * @author daragon
 * 
 */
public interface IDocument {
	/**
	 * 
	 * @param writer
	 * @param file
	 * @throws IOException 
	 * @throws CorruptIndexException 
	 * @throws Exception
	 */
	public void document(IndexWriter writer, File file) throws CorruptIndexException, IOException;

	/**
	 * 
	 * @param writer
	 * @param id
	 * @param filename
	 * @param content
	 * @throws IOException 
	 * @throws CorruptIndexException 
	 * @throws Exception
	 */
	public void document(IndexWriter writer, Serializable id, String filename,
			byte[] content) throws CorruptIndexException, IOException;

	/**
	 * 
	 * @param writer
	 * @param text
	 * @throws IOException 
	 * @throws CorruptIndexException 
	 * @throws Exception
	 */
	public void document(IndexWriter writer, String text) throws CorruptIndexException, IOException;

	/**
	 * 
	 * @param writer
	 * @param id
	 * @param text
	 * @throws IOException 
	 * @throws CorruptIndexException 
	 * @throws Exception
	 */
	public void document(IndexWriter writer, Serializable id, String text) throws CorruptIndexException, IOException;

}
